package com.fengxu.gmall.service.impl;

import com.fengxu.gmall.bean.UserAddress;
import com.fengxu.gmall.service.OrderService;
import com.fengxu.gmall.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    UserService userService;

    @Override
    public List<UserAddress> initOrder(String userId) {
        // 1.查询用户的收货地址
        List<UserAddress> addressList = userService.getUserAddressList(userId);
        // 遍历结果
        addressList.forEach(System.out::println);
        return addressList;
    }
}
